<script setup lang="ts">

import {ArticleCategoryCountResp} from "@/api/article/types";

defineProps<{
  authorId?: number
  articleCategory: ArticleCategoryCountResp[]
}>()
</script>

<template>
<div>
  <div class="bg-white px-5 py-4 rounded-lg">
    <h2 class="widget-title font-bold">分类目录</h2>
    <ul class="mt-3 article-category-ul">
      <li v-for="category in articleCategory" class="article-category-item ">
        <div class="flex flex-row article-category-row mt-3">
          <RouterLink :to="`/article/category/${category.categoryId}?cn=${category.categoryName}` + (authorId ? `&at=${authorId}` : '')">
            <span class="text-lg hover-primary">{{ category.categoryName }}</span></RouterLink>
          <span class="ml-1">{{ '(' + category.articleCount + ')' }}</span>
        </div>
      </li>
    </ul>
  </div>
</div>
</template>

<style scoped>
</style>